import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "@/pages/Home.vue";
import NewsList from "@/pages/NewsList.vue";
import GoodsList from "@/pages/GoodsList.vue";
import My from "@/pages/My.vue";
import NotFound from "@/pages/NotFound.vue";
import Login from "@/pages/Login.vue";
import Index from "@/pages/Index.vue";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index,
    children:[
      {
        path: '/',
        component:Home
      },
      {
        path: '/newslist',
        component: NewsList
      },
      {
        path: '/goodslist',
        component: GoodsList
      },
      {
        path: '/my',
        component: My
      }
    ]
  },
  {
    path: '/login',
    component: Login,
  },
  {
    path: '*',
    component: NotFound,
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
